package db

import (
	"app/config"
	"fmt"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

var db *gorm.DB
var err error

func init() {
	db, err = gorm.Open(mysql.Open(config.DbDsn), &gorm.Config{})
	if err != nil {
		fmt.Println("数据库加载失败")
	}
}
func LoadDb() *gorm.DB {
	return db
}
